package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;

@Getter
@AllArgsConstructor
public enum ScopeMenuEnum {
	COMPANY(1L, "base_organization_company"),
	SITE(2L, "base_organization_business"),
	SUPPLIER(3L, "base_purchase_supplier"),
	USER(4L, "system_accountNumber"),
	PURCHASE(5L, "base_purchase_group"),
	CUSTOMER(6L, "base_client_clientInfo"),
	WAREHOUSE(7L, "base_organization_warehouse");
	/**
	 * id
	 */
	private Long id;

	/**
	 * 描述
	 */
	private String menuCode;

	public static ScopeMenuEnum get(Long id){
		if (Objects.isNull(id)) {
			return null;
		}
		for (ScopeMenuEnum scopeMenuEnum : ScopeMenuEnum.values()){
			if (id.equals(scopeMenuEnum.id))  return scopeMenuEnum;
		}
		return null;
	}
}
